
import request from "@/utils/request";
class CommonAPI {
  /*     图片上传     */
  static gamesUpload (formData) {
    return new Promise((resolve, reject) => {
      request({
        url: `/api/admin/games-upload`,
        headers: {
          "Content-Type": "multipart/form-data",
        },
        method: "POST",
        data: formData,
      }).then(({data}) => {
        resolve(data);
      }).catch((err) => {
        reject(err);
      });
    })
  }
   /*     图片上传     */
   static upload (formData) {
    return new Promise((resolve, reject) => {
      request({
        url: `/api/admin/upload`,
        headers: {
          "Content-Type": "multipart/form-data",
        },
        method: "POST",
        data: formData,
      }).then(({data}) => {
        resolve(data);
      }).catch((err) => {
        reject(err);
      });
    })
  }
  static payment (data) {
    return request({
      url: `/api/admin/payment-methods`,
      method: "GET",
    });
  }
}
export default CommonAPI;